package com.dianshang.dao;

import com.dianshang.pojo.goods.Spec;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecDao extends Mapper<Spec> {

    @Select("SELECT\n" +
            "\t* \n" +
            "FROM\n" +
            "\ttb_spec \n" +
            "WHERE\n" +
            "\ttemplate_id IN ( SELECT template_id FROM tb_category WHERE `name` = #{categoryName}\n" +
            "\t) \n" +
            "ORDER BY\n" +
            "\tseq")
    List<Map> findSpec(String categoryName);

}